package bdz.playground.core
{
	import bdz.common.utils.Vector2D;
	
	import flash.geom.Point;

	public class PenPoint extends Point{
		
		public var next:PenPoint;
		public var prev:PenPoint;
		public var mass:Number = 1.0;
		public var maxSpeed:Number = 10;
		public var edgeBehavior:String = FLOW;
		public var velocity:Vector2D;
		public var rotation:Number;
		public var follow:Vector2D;
		
		public static const WRAP:String = "wrap";
		public static const BOUNCE:String = "bounce";
		public static const AVOID:String = "avoid";
		public static const FLOW:String = "flow";
		
		
		protected var _position:Vector2D;
		
		
		
		public function PenPoint() {
			super();
			_position = new Vector2D(x, y);
			velocity = new Vector2D();
		}
		protected function updatePosition():void{
			x = _position.x;
			y = _position.y;
		}
		protected function render():void{
			
		}
		protected function wrap():void{
			
		}
		protected function avoid():void{
			
		}
		protected function bounce():void{
			
		}
		public function update():void{
			render();
			updatePosition();
		}
		public function set position(v2d:Vector2D):void{
			_position = v2d;
			x = _position.x;
			y = _position.y;
		}
		public function get position():Vector2D{
			return _position;
		}
		
		
	}
}